//
//  QPointsWebVC.m
//  QoilPublic
//
//  Created by 杨凯 on 2017/3/20.
//  Copyright © 2017年 杨凯. All rights reserved.
//

#import "QPointsWebVC.h"

@interface QPointsWebVC ()<UIWebViewDelegate>
{
    UIWebView * _web;
    NSURLRequest *_request;
}
@end

@implementation QPointsWebVC

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    [self WebView];
}
-(void)WebView
{
    _web=[[UIWebView alloc]initWithFrame:self.view.frame];
    _request = [[NSURLRequest alloc]initWithURL:[NSURL URLWithString:_url]];
    _web.scalesPageToFit=YES;
    _web.delegate=self;
    [_web loadRequest:_request];
    [self.view addSubview:_web];
    
}
- (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType{
    [QViewUtility showMBHudToView:self.view hideBg:YES];

    return YES;
}
- (void)webViewDidStartLoad:(UIWebView *)webView{
}
- (void)webViewDidFinishLoad:(UIWebView *)webView{
    
    [QViewUtility hideMBHudToView:self.view];

    self.title = [webView stringByEvaluatingJavaScriptFromString:@"document.title"];
}
- (void)webView:(UIWebView *)webView didFailLoadWithError:(NSError *)error{
    
    [QViewUtility hideMBHudToView:self.view];
    
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
